﻿using System.Collections.Concurrent;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace ZilLion.TPO2O.SDK.EntityBase
{
    public class RequestParamsWrapper
    {
        public RequestParamsWrapper()
        {
            BodyParams=new Dictionary<string, RequestBodyWrapper>();
        }
        public RequestParamsWrapper(IDictionary<string, string> urlParams)
        {
            UrlParams = urlParams;
        }
        public RequestParamsWrapper(IDictionary<string, RequestBodyWrapper> bodyParams)
        {
            BodyParams = bodyParams;
        }
        public RequestParamsWrapper(IDictionary<string, string> urlParams, IDictionary<string, RequestBodyWrapper> bodyParams)
        {
            UrlParams = urlParams;
            BodyParams = bodyParams;
        }
        public IDictionary<string,string> UrlParams { get; set; }

        public IDictionary<string, RequestBodyWrapper> BodyParams { get; set; }


        public string CreateRequest()
        {
            var result = JsonConvert.SerializeObject(this);
#if !DEBUG
               return result.EncodeBase64();
#endif
            return result;
        }
    }
}